<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>文章列表--layui后台管理模板</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="//at.alicdn.com/t/font_tnyc012u2rlwstt9.css" media="all"/>
    <link rel="stylesheet" href="{:_SKIN}/shadmin/v3//css/news.css" media="all"/>
</head>
<body class="childrenBody">
<blockquote class="layui-elem-quote news_search">

    <div class="layui-inline">
        <div class="layui-input-inline">
            <input type="text" value="" placeholder="请输入商品名称或商家名称" class="layui-input search_input">
        </div>
        <a class="layui-btn search_btn">查询</a>
    </div>
    <div class="layui-inline">
        <a class="layui-btn layui-btn-normal newsAdd_btn">添加产品</a>
    </div>
    <div class="layui-inline">
        <a class="layui-btn recommend" style="background-color:#5FB878">推荐文章</a>
    </div>

    <div class="layui-inline">
        <a class="layui-btn layui-btn-danger batchDel">批量删除</a>
    </div>
    <div class="layui-inline">
        <div class="layui-form-mid layui-word-aux">　共找到 {$num} 个商家</div>
    </div>
</blockquote>
<div class="layui-form news_list">
    <table class="layui-table">
        <colgroup>
            <col width="50">
            <col width="18%">
            <col width="10%">
            <col width="6%">
            <col width="6%">
            <col width="6%">
            <col width="10%">
            <col width="15%">
        </colgroup>
        <thead>
        <tr>
            <th></th>
            <th style="text-align:left;">店铺名称</th>
            <th>主营业务</th>
            <th>省</th>
            <th>市</th>
            <th>区/县</th>
            <th>店主</th>
            <th>发布时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="news_content">
    {volist name="list" id="v"}
        <tr>
            <td><input type="checkbox" name="checked" lay-skin="primary" lay-filter="choose">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i class="layui-icon"></i></div>
            </td>
            <td align="left">{$v.Name}  <a href="{:Url('productlist',['bid'=>$v['ID']])}" class="layui-icon">&#xe615;</a></td>
            <td>{$v.MainBus}</td>
            <td>{$v.Province}</td>
            <td>{$v.City}</td>

            <td>{$v.Area} </td>

            <td>{$v.ShopKeeper} <a href="{:Url('productlist',['bid'=>$v['BusinessID']])}" class="layui-icon">&#xe615;</a></td>
          {eq name="v.ISSells" value="1"}
            <td><input type="checkbox" name="show" lay-skin="switch" lay-text="上架|下架" lay-filter="isShow"  data-id="{$v.ID}"  checked=""></td>
          {else /}
            <td><input type="checkbox" name="show" lay-skin="switch" lay-text="上架|下架" lay-filter="isShow" data-id="{$v.ID}" ></td>
            {/eq}





            <td><a class="layui-btn layui-btn-mini bus_info"  data-url="{:url('business',['id'=>$v['ID']])}">详情</a>

                {eq name="v.ISSells" value="1"}

                <a class="layui-btn layui-btn-normal layui-btn-mini news_collect pro_sells" data-id="{$v.ID}" >审核</a>

                {else /}

                <a class="layui-btn layui-btn-normal layui-btn-mini news_collect pro_sells" data-id="{$v.ID}">上架</a>


                {/eq}



                <a class="layui-btn layui-btn-danger layui-btn-mini pro_del"  data-id="{$v.ID}">删除</a>


            </td>
        </tr>
    {/volist}
        </tbody>
    </table>
</div>

<div id="page">{$page}</div>
{:jq()}
{:layui()}
<style>
    .pagination { margin-left: 50px;}
    .pagination li { float: left; background: #34a8fe; color: #fff; margin-right:8px ; }
    .pagination li a,.pagination li span { color:#fff;padding: 8px 10px;display: block}
    .pagination .active  { background-color: #fe6738}

</style>
<script>

  //删除商品
    $(".bus_info").click(function(){
      var id=$(this).data('url');

      parent.layer.open({
          type: 2,
          area: ['760px', '450px'],
          fixed: false, //不固定
          maxmin: false,

          content: [id,"no"]
      });


  });




  layui.form.on('switch(isShow)', function(data){
      var id=$(data.elem).data('id');


      var key= data.elem.checked ? 1 :0;

      $.post("{:url('dev/sells')}",{id:id,key:key},function(res){

          if(res.code!=200){

            panent.layer.alert('网络繁忙，请重试');

          }

      });






  });
</script>
</body>
</html>